
// =================================================================== 
// class description : 
// =================================================================== 
// File: Deduct.cs
// Copyright  @ AC
// History:
// 		2012/7/25  created by 
// 
// =================================================================== 
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;

namespace InternalManagementSystem.DAO.Models
{
	/// <summary>
	///
	/// </summary>
    public class Deduct
	{
		#region Private Variables
		
		private System.Int32 _deductID;
		
		private System.Int32 _userID;

        private System.String _reason = string.Empty;

        private System.Int32 _deductIntegral;

        private System.Int32 _deductType;

        private System.Int32 _violationNID;

        private System.Int32 _commiter;
        
        
		#endregion
		
		#region Constructors
		
	    public Deduct()
		{
		}
		
		public Deduct(System.Int32 deductID)
		{
			_deductID = deductID;
	
		}
		
		public Deduct(bool populateDefaultValue) : this()
		{
			if(populateDefaultValue)
			{
				_deductID = 0;
				_userID = 0;
				_reason = string.Empty;
			}
		}
		
		public Deduct(
			System.Int32 deductID,
			System.Int32 userID,
			System.String reason
		)
		{
			_deductID = deductID;
			_userID = userID;
			_reason = reason;
			
		}
		
		#endregion
		
		#region Properties
		
		public System.Int32 DeductID
		{
			get {return _deductID;}
			set {_deductID = value;}
		}
		
		public System.Int32 UserID
		{
			get {return _userID;}
			set {_userID = value;}
		}

        public System.Int32 DeductIntegral
		{
            get { return _deductIntegral; }
            set { _deductIntegral = value; }
		}

        public System.Int32 DeductType
		{
            get { return _deductType; }
            set { _deductType = value; }
		}

        public System.Int32 ViolationNID
		{
            get { return _violationNID; }
            set { _violationNID = value; }
		}
        
		public System.String Reason
		{
			get {return _reason;}
			set {_reason = value;}
		}

        public System.Int32 Commiter
		{
            get { return _commiter; }
            set { _commiter = value; }
		}
		
		#endregion
	}
	
	/// <summary>
	/// 
	/// </summary>
    public class DeductCollection : CollectionBase
	{
		public Deduct this[int index]
        {
            get
            {
                return ((Deduct)(List[index]));
            }
            set
            {
                List[index] = value;
            }
        }

        public void Add(Deduct item)
        {
            if ((item == null))
            {
                throw new System.Exception("can't add null into collection");
            }
            else
            {
                try
                {
                    List.Add(item);
                }
                catch (NotSupportedException ex)
                {
                    throw new System.Exception((ex.Message + ex.StackTrace));
                }
            }
        }
	}
}